<template>
	<view>
		<view>
			<view class="" style="display: flex; margin-top: 40rpx; padding: 40rpx 60rpx">
				<view class="">
					<image style="width: 200rpx; height: 250rpx;" @click="clickImg(studentInfo.stuPhoto)"
						:src="studentInfo.stuPhoto ?studentInfo.stuPhoto:'https://tj-1305380059.cos.ap-nanjing.myqcloud.com/pic/boy.png'"
						mode=""></image>
				</view>
				<view style="margin-left: 80rpx;display: flex; flex-direction: column; justify-content: space-around;">
					<view style="display: flex; width: 400rpx; margin-top: 8rpx;">
						<view class="character">宿舍号：</view>
						<view class="character">{{studentInfo.dormitoryName}}</view>
					</view>
					<view style="display: flex; width: 400rpx; margin-top: 8rpx;">
						<view class="character">姓名：</view>
						<view class="character">{{studentInfo.studentName}}</view>
					</view>
					<view style="display: flex; width: 400rpx; margin-top: 8rpx;">
						<view class="character">性别：</view>
						<view class="character">{{studentInfo.sex == 0 ?"男" :"女"}}</view>
					</view>
					<view style="display: flex; width: 400rpx; margin-top: 8rpx;">
						<view class="character">班级：</view>
						<view class="character">{{studentInfo.className}}</view>
					</view>

					<view style="display: flex; margin-top: 8rpx;">
						<view class="character">班主任：</view>
						<view class="character">{{studentInfo.teacherName}}</view>
					</view>
					<view style="display: flex; margin-top: 8rpx;">
						<view class="character">班主任电话：</view>
						<view class="character">{{studentInfo.teacherPhone}}</view>
					</view>
				</view>
			</view>

			<view
				style="display: flex; padding: 60rpx 60rpx 0 60rpx; align-items: center; justify-content: space-between;">
				<view class="" style="display: flex; align-items: center;">
					<image src="../../../static/pic/tixinglanse.png"
						style="width: 50rpx; height: 50rpx; padding: 10rpx;" mode=""></image>
					<view>宿舍补卡处理</view>
				</view>
				<view class="" style="display: flex;">
					<!-- <view class="" style="font-size: 28rpx; color: #aaa;">对未打卡学生进行拍照补卡</view> -->

					<uni-icons v-if="checkShow" type="bottom" size="20" @click="changeCheckShow"></uni-icons>
					<uni-icons v-else type="top" size="20" @click="changeCheckShow"></uni-icons>
				</view>
			</view>

			<view v-if="checkShow">
				<view style="display: flex; padding:0 60rpx; align-items: center; justify-content: space-between;">
					<view class="" style="display: flex; align-items: center;">
						<image src="" style="width: 50rpx; height: 50rpx; padding: 10rpx;" mode=""></image>
						<view style="color: #aaa;">对未打卡学生进行拍照补卡</view>
					</view>
				</view>
				<view class="" style="display: flex; align-items: center; justify-content: center;">
					<image @click="clickImg" :src="this.imgSrc" mode="" style="width: 470rpx; height: 300rpx;"></image>
				</view>
				<view class="" style="text-align: center; padding: 20rpx 0 ; color: red;font-size: 26rpx	;" >补卡时间：{{modifyTime}}</view>
				<view class="tijiao" @click="submitCard">提交在寝补卡</view>
			</view>

		</view>
	</view>
</template>

<script>
	import taskNotReturned from "@/api/modules/taskNotReturned.js"
	import managementTeacher from "@/api/modules/managementTeacher.js"
	import teacherClass from "@/api/modules/teachClass.js"
	import {
		parseTime
	} from "@/utils/date.js"
	export default {
		data() {
			return {
				topName: "已补卡",
				userName: "",
				studentInfo: {},
				notReturnedDate: "",
				reason: "",
				buildNo: "",
				date: "",
				studentId: "",
				checkShow: true,
				id: "",
				imgSrc: "",
				modifyTime: "",
			}
		},
		methods: {
			clickImg(img) {
				uni.previewImage({
					urls: [this.imgSrc], //需要预览的图片http链接列表，多张的时候，url直接写在后面就行了
					current: '', // 当前显示图片的http链接，默认是第一个
					success: function(res) {},
					fail: function(res) {},
					complete: function(res) {},
				})
			},
			changeCheckShow(){
				this.checkShow = !this.checkShow
			}

		},
		onLoad(options) {
			console.log(options.buildNo)
			console.log(options.searchDate)
			this.bzrUrl =
				`/pages/managementTeacher/unCheckedStudents/unCheckedStudents?buildNo=${options.buildNo}&searchDate=${options.searchDate}&current=${options.current}`
			this.modifyTime = options.modifyTime
			var that = this
			this.imgSrc = `${that.$baseAppUrl}common/downloadFileImg?filename=${options.mendCardPhoto}`
			this.userName = uni.getStorageSync("userName")
			this.studentId = options.studentId
			this.id = options.id
			taskNotReturned.getStudentById(this.studentId).then(res => {
				this.studentInfo = res.data
			})
			console.log(options)

		}
	}
</script>

<style scoped>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.indexContent {
		height: 100vh;

	}

	.tijiao {
		margin: 20rpx auto 0;
		width: 450rpx;
		background-color: #aaa;
		padding: 20rpx;
		text-align: center;
		border-radius: 20rpx;
		color: #fff;
		font-size: 28rpx;
		box-shadow: rgba(0, 0, 0, 0.08) 0px 0px 3px 1px;
		height: 60rpx;
		line-height: 60rpx;
	}

	.character {
		font-size: 26rpx;
		color: #444;
	}
</style>